Trò chơi 2D Cow Boy Runner

52.965 lượt xem;
1 using System.Collections;
2 using
System.Collections.Generic;
3 using
UnityEngine;
4 using
UnityEngine.UI;
5 using
UnityEngine.SceneManagement;
6
7 public
class MenuManager : MonoBehaviour {
8
9     
[SerializeField]
10     
public GameObject instructionPanel;
11
12     
[SerializeField]
13     
public Button playButton, menuButton, quitButton; //, closeButton;
14
15     
[SerializeField]
16     
public GameObject image;
17
18     
// Use this for initialization
19     
void Start () {
20         
21     }
22     
23     
// Update is called once per frame
24     
void Update () {
25         
26     }
27
28     
public void playGame () {
29         Time.timeScale =
1f;
30         SceneManager.LoadScene (
"Gameplay");
31     }
32
33     
public void instructionMenu () {
34         instructionPanel.SetActive (
true);
35         playButton.gameObject.SetActive (
false);
36         quitButton.gameObject.SetActive (
false);
37         menuButton.gameObject.SetActive (
false);
38         image.SetActive (
false);
39     }
40
41     
public void quitGame () {
42         Application.Quit ();
43     }
44
45     
public void closeInstruction () {
46         instructionPanel.SetActive (
false);
47         playButton.gameObject.SetActive (
true);
48         quitButton.gameObject.SetActive (
true);
49         menuButton.gameObject.SetActive (
true);
50         image.SetActive (
true);
51     }
52 }


public Button playButton, menuButton, quitButton; , closeButton;

Use this for initialization

Update is called once per frame



Gõ tìm kiếm nhanh...